package com.qcu.controller.user;

import com.qcu.agent.ShuGoAI;
import com.qcu.dto.ChatInfo;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

/**
 * @Name: MyComputer
 * @ClassName ShuGoController
 * @Description:
 * @date 2025/4/24 18:30
 */
@RestController
@RequestMapping("/ShuGo")
public class ShuGoController {

    @Resource
    private ShuGoAI shuGoAI;

    @PostMapping(value="/chat",produces = "text/stream;charset=utf-8")
    public Flux<String>  chat(@RequestBody ChatInfo info) {
        return shuGoAI.chat(info.getMemoryId(),info.getMessage());
    }
}
